function Buffer(context, vector, itemSize){
	this.vector = vector;
	this.context = context;
	this.itemSize = itemSize;
	this.itemsCount = vector?vector.length / itemSize:0;
	this.buffer = null;

	this.create = function(){
	}
}

ArrayBuffer.prototype = new Buffer;
function ArrayBuffer(context, vector, itemSize){
	this.base = Buffer; 
	this.base(context, vector, itemSize);
	
	this.create = function(){
		this.buffer = this.context.createBuffer();
		this.bind();
		context.bufferData(this.context.ARRAY_BUFFER, new Float32Array(this.vector), this.context.STATIC_DRAW);
		this.buffer.itemSize = this.itemSize;
		this.buffer.itemsCount = this.itemsCount;
	}
	
	this.bind = function(){
		context.bindBuffer(this.context.ARRAY_BUFFER, this.buffer);
	}
	
	this.create();
}
ElementsArrayBuffer.prototype = new Buffer;
function ElementsArrayBuffer(context, vector, itemSize){
	this.base = Buffer; 
	this.base(context, vector, itemSize);
	
	this.create = function(){
		this.buffer = this.context.createBuffer();
		this.bind();
		context.bufferData(this.context.ELEMENT_ARRAY_BUFFER, new Float32Array(this.vector), this.context.STATIC_DRAW);
		this.buffer.itemSize = this.itemSize;
		this.buffer.itemsCount = this.itemsCount;
	}
	
	this.bind = function(){
		context.bindBuffer(this.context.ELEMENT_ARRAY_BUFFER, this.buffer);
	}
	
	this.create();
}